-
-
Notifications
You must be signed in to change notification settings - Fork 307
Conversation
## Return Value | ||
|
||
The return value would be a unique and constant `integer`. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Duplicate line can be removed.
converted object heading to h4 and removed duplicate line about return value.
@theflametrooper I've implemented the changes. Could you check if that is what you suggested? |
|
||
## Argument | ||
|
||
#### object |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-#### object
+### object
I made some changes, there was no reason to go for h4 after a h2. |
Thanks @Rafase282 . What else is required for this PR to be accepted? |
From me, just that. |
@@ -0,0 +1,42 @@ | |||
# Python id(object) | |||
|
|||
`id()` is a built-in function in Python 3, which returns the *identity* of an object. The *identity* is a unique integer for that object during its lifetime. In CPython implementation, this is the address of the object in memory which is not necessarily true for other python implementations. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In CPython implementation
A beginner would want to know what you mean by CPython implementation, so better link to the GitHub mirror of CPython interpreter, or some article that talks about this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
which is not necessarily true for other python implementations.
I know that CPython is not a perform-ant implementation. PyPy and Pyston would probably handle performance better by moving around objects in memory.
But reading it, it feels like that id()
need to be same, is not part of the spec. Is that so? I am not fully aware of this.
Thanks for the article @gouravchawla ! Great job 👍 I don't come across people often who care about underlying implementation details of a language. Just fix as per the comments on the article, and we are ready to merge. |
The different python implementation details are confusing and could be ignored. The id() function is not used that much so omitting the statement makes more sense.
Thanks @alayek . Also, I've made some changes and I think omitting the details about implementation makes more sense as the id() function is not used that much. Even the official documentation doesn't say much about it. |
LGTM 👍 |
For issue #819